const express = require('express');
const router = express.Router();
const authenticateToken = require('../middleware/authMiddleware');
const { uploadImage, getImage } = require('../controllers/imageController');
const multer = require('multer');

// 配置 multer 存储
const storage = multer.memoryStorage(); // 将文件存储在内存中
const upload = multer({ storage: storage });

// 应用 multer 中间件
router.post('/upload', authenticateToken, upload.single('image'), uploadImage);

module.exports = router;